package com.wbqianrushi;

/**
 * @author 黄衡熙
 * @version 1.0
 */

import java.util.Scanner;

/**
 * 九九乘法表
 * 定义一个函数，生成n行m列的九九乘法表，其中m<=n，显示不完整的列，给出省略的提示
 */
public class Test01_乘法口诀1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入行数:");
        int a = sc.nextInt();
        System.out.print("请输入列数:");
        int b = sc.nextInt();
        for (int i = 1; i <= a; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(j + "x" + i + "=" + j * i + "\t");
                if (j == b) {
                    System.out.print("...\t" + "(共" + i + "列)");
                    break;
                }
            }
            System.out.println();
        }
    }
}
